<!--eslint-disable-->
<template>
    <div class="dianzu">
        <svg
            t="1689663205656"
            class="icon"
            viewBox="0 0 1637 1024"
            version="1.1"
            xmlns="http://www.w3.org/2000/svg"
            p-id="1531"
            width="200"
            height="200">
            <path
                d="M1564.672 586.24h-389.632c-11.264 0-19.968-11.264-19.968-25.6v-3.584c0-14.336 8.704-25.6 19.968-25.6h389.632c11.264 0 19.968 11.264 19.968 25.6v3.584c0 14.336-8.704 25.6-19.968 25.6zM453.12 586.24H61.44c-11.264 0-20.48-11.264-20.48-25.6v-3.584c0-14.336 8.704-25.6 20.48-25.6h392.192c11.264 0 20.48 11.264 20.48 25.6v3.584c-0.512 13.824-9.728 25.6-20.992 25.6z"
                :fill="element.style.backgroundColor" p-id="1532"></path>
            <path
                d="M1144.32 724.992h-665.6c-28.672 0-51.2-22.528-51.2-51.2v-230.4c0-28.672 22.528-51.2 51.2-51.2h665.6c28.672 0 51.2 22.528 51.2 51.2v230.4c0 28.672-22.528 51.2-51.2 51.2z m-665.6-281.6v230.4h665.6v-230.4h-665.6z"
                :fill="element.style.backgroundColor" p-id="1533"></path>
        </svg>
        <v-text :prop-value="element.propValue" :element="element"/>
    </div>
</template>

<script>
import request from '@/utils/request'
import OnEvent from '../../common/OnEvent'

export default {
    extends: OnEvent,
    props: {
        propValue: {
            type: String,
            required: true,
            default: '',
        },
        request: {
            type: Object,
            default: () => {
            },
        },
        element: {
            type: Object,
            default: () => {
            },
        },
    },
    data() {
        return {
            cancelRequest: null,
        }
    },
    created() {
        if (this.request) {
            this.cancelRequest = request(this.request, this.propValue, 'data')
        }
    },
    beforeDestroy() {
        this.request && this.cancelRequest()
    },
}
</script>

<style lang="scss" scoped>
.dianzu {
    display: inline-block;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    outline: 0;
    margin: 0;
    width: 100%;
    height: 100%;

    .icon {
        width: 100%;
        height: 100%;
    }

    .v-text {
        position: absolute;
        left: 50%;
        transform: translate(-50%, 0);
        width: 50%;
        height: 40%;
    }
}
</style>
